/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.lczyfz.wisdom.modules.platform.vueweb;

import com.lczyfz.wisdom.common.utils.ServerResponse;
import com.lczyfz.wisdom.common.web.BaseController;
import com.lczyfz.wisdom.modules.platform.entity.Order;
import com.lczyfz.wisdom.modules.platform.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 订单Controller
 * @author css
 * @version 2019-09-26
 */
@Api(value = "order",description = "订单接口")
@RestController
@RequestMapping(value = "${apiPath}/order/order")
public class VueOrderController extends BaseController {

	//private static final String WX_URL = url+"?access_token="+TOKEN+"&openid="+OPENID+"&lang="+LANG;
	@Autowired
	private OrderService orderService;
	
	@ApiOperation(value = "订单列表",notes = "订单列表")
	@RequestMapping(value = "myOrderList",method = RequestMethod.GET)
	public ServerResponse<Order> myOrderList(@RequestParam String userId) {
		return orderService.getList(userId);
	}


	/**
	 * 提交订单(预约)
	 * @param order
	 * @return
	 */
	@ApiOperation(value = "订单保存",httpMethod = "POST")
	@RequestMapping(value = "orderSave", method = RequestMethod.POST)
	public ServerResponse<Object> orderSave(@RequestBody Order order) {
		return orderService.addOrder(order);
	}





}